package com.css.usercenter.study.controller;


import com.css.usercenter.study.entity.User;
import com.css.usercenter.study.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 分享 前端控制器
 * </p>
 *
 * @author css
 * @since 2019-12-08
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @Value("${server.port}")
    private String port;

    @GetMapping("/id")
    public String get(@RequestParam("id") Integer id) {
        User byId = userService.getById(1);
        System.out.println(id);
        return port + "user/id" + id;
    }
}

